package JUC.assist;

import java.util.concurrent.CountDownLatch;

/**
 * @author mubei
 * @date 2021/11/21
 * @description
 */
public class TestCountDownLatch {

    public static void main(String[] args) throws InterruptedException {
        CountDownLatch latch = new CountDownLatch(7);


        for (int i = 1; i <= 6 ; i++) {
            new Thread(()->{
                System.out.println(Thread.currentThread().getName()+"get out");
                latch.countDown();
            },String.valueOf(i)).start();
        }

        latch.await();
        System.out.println("close door");
    }
}
